import java.awt.*;
import java.awt.event.*;

public class project extends Frame implements ActionListener{
	Button bt1,bt2,bt3,bt4,bt5,bt6;
	Label label0,label1;
	Panel p01;
	TextField text1;
	String msg="당신이 좋아하는 지명을 선택 하기 바랍니다.";
	String msg1="선택한 지명: ";
	String msg2="";
	public project(){
		super("버튼/텍스트 필드 생성과 이벤트 처리");
		setLayout(new FlowLayout());
		
		//p01 = new Panel();
		label1= new Label(msg);
		bt1 = new Button("천안");
		bt2 = new Button("당진");
		bt3 = new Button("속초");
		bt4 = new Button("서울");
		bt5 = new Button("제주");
		text1 = new TextField(msg1 ,15);
		add(label1);
		add(bt1);
		add(bt2);
		add(bt3);
		add(bt4);
		add(bt5);
		add(text1);
		
		label0 = new Label(" 종료 : ");
		bt6 = new Button("종료");
		add(label0);
		add(bt6);
		setSize(300,300);
		setVisible(true);
		
		
		bt1.addActionListener(this);
		bt2.addActionListener(this);
		bt3.addActionListener(this);
		bt4.addActionListener(this);
		bt5.addActionListener(this);
		bt6.addActionListener(this);
	}
	public static void main(String[] args){
		project pr = new project();
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		String str = e.getActionCommand();
		if(str.equals("종료")) System.exit(0);
		else {
			msg2=e.getActionCommand();
			text1.setText(msg1+msg2);
		}
		// TODO Auto-generated method stub	
	}
}